﻿using System.Collections.Generic;
using System.Linq;
using NHibernate;
using NHibernate.Linq;
using Noodles.Core.Model;
using System;
using System.Xml.Serialization;
using System.IO;
using System.Web.Hosting;
using NHibernate.Hql;
using NHibernate.Criterion;

namespace Noodles.Core.Repositories
{
    class BlogRepository : IBlogRepository
    {
        private readonly ISession session;

        public BlogRepository(ISession _session)
        {
            session = _session;
        }
        public int GetIDFromTitle(string Title)
        {   
            int ID=0;
         
          var blogs = session.CreateCriteria<BlogPost>()
                .CreateCriteria("Posts")
                .Add(Restrictions.Eq("Title", Title))
                .List<BlogPost>();
           
           return ID;    
        }
    }
}
